import Vue from 'vue'
import Router from 'vue-router'
import Home from './pages/home'
import Index from './pages/index'
// import Home_s from './pages/home_s'
import OrderIndex from './pages/order'

Vue.use(Router)

export default new Router(
    {
        routes: [
            {
                path: '/',
                name: 'home',
                component: Home,
                redirect: '/index',
                children: [
                    {
                        path: '/index',
                        name: 'index',
                        component: Index,
                    },
                    {
                        path: '/product/:id',
                        name: 'product',
                        component: () => import('./pages/product'),
                    },
                    {
                        path: '/product/detail/:id',
                        name: 'productDetail',
                        component: () => import('./pages/product/detail'),
                    }
                ]
            },
            // {
            //     path: '/order',
            //     name: 'home_s',
            //     component: Home_s,
            //     redirect: '/order',
            //     children: [
            //         {
            //             path: '/order',
            //             name: 'index',
            //             component: OrderIndex,
            //         },
            //         {
            //             path: '/shopCar',
            //             name: 'shopCar',
            //             component: () => import('./pages/shopCar'),
            //         },
            //         {
            //             path: '/orderConfirm',
            //             name: 'orderConfirm',
            //             component: () => import('./pages/order/orderConfirm'),
            //         },
            //     ]
            // },
            {
                path: '/order',
                name: 'order',
                component: OrderIndex,
            },
            {
                path: '/shopCar',
                name: 'shopCar',
                component: () => import('./pages/shopCar'),
            },
            {
                path: '/order/confirm',
                name: 'orderConfirm',
                component: () => import('./pages/order/confirm'),
            },
            {
                path: '/login',
                name: 'login',
                component: () => import('./pages/login')
            },
            {
                path: '/order/pay',
                name: 'order',
                component: () => import('./pages/order/pay'),
            },
            {
                path: '/order/alipay',
                name: 'alipay',
                component: () => import('./pages/order/alipay'),
            },
        ]
    },
)